import request from '@/utils/request'
import qs from "qs"
export default {

    pageInfo(pageNum, pageSize) {
        var data = qs.stringify({ "pageNum": pageNum, "pageSize": pageSize })
        return request({
            url: '/api-goods/template/templates',
            // utl: 'http://localhost:9999/api-goods/template/templates',
            method: 'post',
            data
        })
    },
    findById(id) {
        return request({
            url: `/api-goods/template/template/${id}`,
            method: 'get'
        })
    },
    deleteById(id) {
        return request({
            url: `/api-goods/template/template/${id}`,
            method: 'delete'
        })
    },
    //根据id修改数据
    updateById(id, name) {
        var data = qs.stringify({ "id": id, "name": name })
        return request({
            url: '/api-goods/template/template',
            method: 'put',
            data
        })
    },
    add(name, id) {
        var data = qs.stringify({ "name": name, "id": id })
        return request({
            url: '/api-goods/template/template',
            // utl: 'http://localhost:9999/api-goods/template/template',
            method: 'post',
            data
        })
    },
    //查询所有模板
    findAll() {
        return request({
            url: '/api-goods/template/templates',
            method: 'get'
        })
    }

}